package singleton;/** * Created by Administrator on 2018-10-23. * 非单例模式的巧克力锅炉 */public class ChocolateBoiler {    private boolean empty;    private boolean boiled;    public ChocolateBoiler() {        empty = true;        boiled = false;    }    /**     * 锅炉填装     */    public void fill() {        if (isEmpty()) {            empty = false;            boiled = false;        }    }    /**     * 锅炉排出     */    public void drain() {        if (!isEmpty() && isBoild()) {            empty = true;        }    }    /**     * 煮沸混合物     */    public void boil() {        if (!isEmpty() && !isBoild()) {            boiled = true;        }    }    private boolean isBoild() {        return boiled;    }    private boolean isEmpty() {        return empty;    }}